{include file='header.tpl'}
{include file='admin/leftcol.tpl'}
<div id="left-area">
    <span class="td4"> 
        <div class="breadcrumb">
            <span class="raquo"></span><a href="/">Главная</a>
            <span class="raquo"> &raquo; </span><a href="{geturl controller="admin" action="index"}">Админ панель</a>  
            <span class="raquo"> &raquo; </span><a href="{geturl controller='admin' action='help'}">Помощь</a>  
        </div>
        <h1 class="category-title">Помощь</h1>
        <a href="{geturl route='addhelpcat'}" class="button pink" >Добавить категорию</a>
        <br />
        <br />
        <table width="100%">
            <tr>
                <th>
                    Название
                </th>
                <th>
                    Действие
                </th>
            </tr>
            {foreach from=$cats item='cat'}
                <tr>
                    <td>
                        {$cat->name}
                    </td>
                    <td> 
                        <a href="{geturl route='edithelpcat' id=$cat->getId()}"><img src="/images/index-14.png" /></a> 
                        <a href="{geturl route='deletehelpcat' id=$cat->getId()}"><img src="/images/index-07.png" /></a>
                    </td>
                </tr>
                {if $cat->childs|@count > 0}
                    {foreach from=$cat->childs item='subcat'}
                        <tr>
                            <td style='padding-left: 20px; width: 50%;'>
                                <a href="{geturl route='viewhelpcat' id=$subcat->getId()}">{$subcat->name}</a>
                            </td>
                            <td> 
                                <a href="{geturl route='edithelpcat' id=$subcat->getId()}"><img src="/images/index-14.png" /></a> 
                                <a href="{geturl route='deletehelpcat' id=$subcat->getId()}"><img src="/images/index-07.png" /></a>
                            </td>
                        </tr>
                    {/foreach}
                {/if}
            {foreachelse}
                <tr><td colspan="2">Нет категорий</td></tr>
            {/foreach}
        </table>
        <a href="{geturl route='addhelpcat'}" class="button pink" >Добавить категорию</a>
    </span>
</div>
{include file='footer.tpl'}